<%@ page contentType="text/html;charset=UTF-8" language="java"  import="java.util.*" trimDirectiveWhitespaces="true" %>
<%@include file="/WEB-INF/pages/common/taglib.jsp"%>
<!DOCTYPE html>
<html lang="en">
<head>
    <title>翻新服务价格管理</title>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <%@include file="/WEB-INF/pages/common/commonCss.jsp"%>
    <link rel="stylesheet" href="${basePath}/resources/css/uniform.css" />
    <link rel="stylesheet" href="${basePath}/resources/css/select2.css" />
    <link rel="stylesheet" href="${basePath}/resources/css/matrix-style.css" />
    <link rel="stylesheet" href="${basePath}/resources/css/matrix-media.css" />
    <link rel="stylesheet" href="${basePath}/resources/css/admin/list.css" />
</head>

<body>

<style>
    .refurbishShow{
        display: inline-block;
    }
    .refurbishHide{
        display: none;
    }
    #inp.refurbishHide{
        display: none;
    }
</style>
<!--Header-part-->
<%@include file="/WEB-INF/pages/common/head.jsp"%>


<!--sidebar-menu-->
<%@include file="/WEB-INF/pages/common/left.jsp"%>

<div id="content">
    <div id="content-header">
        <div id="breadcrumb"> <a href="#" title="Go to Home" class="tip-bottom"><i class="icon-home"></i> 首页</a> <a href="#" class="current">翻新服务价格管理</a> </div>
        <%--<h1>商城订单管理</h1>--%>
    </div>
    <div class="container-fluid">
        <%--<input type="text" value="1980.00">--%>
        <hr>
        <p>当前翻新价格:￥<span style="" class="refurbishShow" id="price">${refurbishPrice.codeValue}</span>
            <input id="inp" class="refurbishHide" type="text" value="${refurbishPrice.codeValue}">

            <a style="margin-top: -0.6rem" onclick="updateRefurbishPrice(${refurbishPrice.id} ,this)" class="btn btn-success">
                <i class="icon-pencil icon-white"></i>修改</a>
        </p>


    </div>
</div>



<!-- 模态框（Modal） -->
<!--Footer-part-->
<%@include file="/WEB-INF/pages/common/footer.jsp"%>

<!--end-Footer-part-->

<%@include file="/WEB-INF/pages/common/commonJS.jsp"%>
<script type="text/javascript" src="${basePath}/resources/sg/tz_page.js"></script>
<script src="${basePath}/resources/js/jquery.ui.custom.js"></script>
<script src="${basePath}/resources/js/bootstrap.min.js"></script>
<script src="${basePath}/resources/js/jquery.uniform.js"></script>
<script src="${basePath}/resources/js/select2.min.js"></script>
<script src="${basePath}/resources/js/jquery.dataTables.min.js"></script>
<script src="${basePath}/resources/js/matrix.js"></script>
<%--<script src="${basePath}/resources/js/matrix.tables.js"></script>--%>

<script>
    $(function(){
        tzAdmin.loadData(0,10,function(itemCount){
            tzAdmin.initPage(itemCount);//分页加载一次吗
        });
    });

    var flag = false;
    function  updateRefurbishPrice(id ,obj) {
        if(obj.innerHTML=="确定"){
            flag = true;
            var price = $("#inp").val();
        }
        console.log(flag);

        if(flag){
            $.ajax({
                url:adminPath+"/order/refurbish/updateRefurbishPrice",
                type:'post',
                data:{id:id , codeValue: price},
                success:function (data) {
                    if(data == 1){
                        loading("修改翻新价格成功" , 4);
                        $("#price").html(price);
                        flag = !flag;
                    }
                }
            });
        }
        obj.innerHTML =  obj.innerHTML=="确定" ? "修改" : "确定";
        $("#price").toggleClass("refurbishHide refurbishShow");
        $("#inp").toggleClass("refurbishHide refurbishShow");

    }




</script>

</body>
</html>
